package com.example.houseman.controller;


import com.example.houseman.entity.TSfTermination;
import com.example.houseman.service.ITSfTerminationService;
import com.github.pagehelper.PageInfo;
import com.org.dto.TSfTerminationDto;
import com.org.vo.ResultEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 龚梦
 * @since 2021-04-02
 */
@RestController
@Slf4j
@RequestMapping("/hou/TSfTerminationController")
public class TSfTerminationController {

    @Autowired
    ITSfTerminationService itSfTerminationService;

    @RequestMapping("list")
    public ResultEntity list(TSfTerminationDto tSfTerminationDto) {

        PageInfo<TSfTermination> list = itSfTerminationService.getlist(tSfTerminationDto);

        return ResultEntity.ok("200", "成功", list);
    }


    @RequestMapping("savetermination")
    public ResultEntity savetermination(@RequestBody TSfTerminationDto sfTerminationDto) {
        log.info("接参" + sfTerminationDto);
        itSfTerminationService.savetermination(sfTerminationDto);
        return ResultEntity.ok("解约协议录入成功");
    }
}
